home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 November / Chip Kasım 2001.iso / prog / cdcode / smartsdk / setup.exe / stsdk.msi / SimpleTerm2.cpp.C6DB95E3_9157_4174_9574_EF0371EC54EB < prev    next >
Encoding:
Text File  |  2000-12-15  |  2.0 KB  |  75 lines

  1. // SimpleTerm2.cpp : Implementation of DLL Exports.
  2.  
  3.  
  4. // Note: Proxy/Stub Information
  5. //      To build a separate proxy/stub DLL, 
  6. //      run nmake -f SimpleTerm2ps.mk in the project directory.
  7.  
  8. #include "stdafx.h"
  9. #include "resource.h"
  10. #include <initguid.h>
  11. #include "SimpleTerm2.h"
  12.  
  13. #include "SimpleTerm2_i.c"
  14. #include "STRecognizer.h"
  15. #include "STAction.h"
  16.  
  17.  
  18. CComModule _Module;
  19.  
  20. BEGIN_OBJECT_MAP(ObjectMap)
  21. OBJECT_ENTRY(CLSID_STRecognizer, CSTRecognizer)
  22. OBJECT_ENTRY(CLSID_STAction, CSTAction)
  23. END_OBJECT_MAP()
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // DLL Entry Point
  27.  
  28. extern "C"
  29. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  30. {
  31.     if (dwReason == DLL_PROCESS_ATTACH)
  32.     {
  33.         _Module.Init(ObjectMap, hInstance, &LIBID_SIMPLETERM2Lib);
  34.         DisableThreadLibraryCalls(hInstance);
  35.     }
  36.     else if (dwReason == DLL_PROCESS_DETACH)
  37.         _Module.Term();
  38.     return TRUE;    // ok
  39. }
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // Used to determine whether the DLL can be unloaded by OLE
  43.  
  44. STDAPI DllCanUnloadNow(void)
  45. {
  46.     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  47. }
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // Returns a class factory to create an object of the requested type
  51.  
  52. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  53. {
  54.     return _Module.GetClassObject(rclsid, riid, ppv);
  55. }
  56.  
  57. /////////////////////////////////////////////////////////////////////////////
  58. // DllRegisterServer - Adds entries to the system registry
  59.  
  60. STDAPI DllRegisterServer(void)
  61. {
  62.     // registers object, typelib and all interfaces in typelib
  63.     return _Module.RegisterServer(TRUE);
  64. }
  65.  
  66. /////////////////////////////////////////////////////////////////////////////
  67. // DllUnregisterServer - Removes entries from the system registry
  68.  
  69. STDAPI DllUnregisterServer(void)
  70. {
  71.     return _Module.UnregisterServer(TRUE);
  72. }
  73.  
  74.  
  75.